import numpy as np
import pandas as pd
df4 = pd.DataFrame(np.arange(12).reshape(4,3),index=list('abcd'),columns=list('xyz'))
df4.iloc[1:3,0:2] = np.nan
df4.iloc[2,2] = np.nan
print(df4)

x=df4.dropna(how='all')
y=df4.dropna(thresh=2)
print(x)
print(y)